package genetic.stopCondition;

import genetic.interfaces.Individual;
import genetic.interfaces.Population;
import genetic.interfaces.StopCondition;

public class MarioStopCondition<Fitness extends Number & Comparable<Fitness>, I extends Individual<?, ?>> implements StopCondition {

	private Population<I> pop;
	private Integer count = 0;
	private Integer max= 0;
	
	public MarioStopCondition(Population<I> pop, Integer maxExecutions) {
		this.pop = pop;
		max = maxExecutions;
	}
	
	/*
	 * Condição de parada por número de execuções
	 */
	@Override
	public boolean stopCondition() {
		count++;
		return !(count < max);
	}

}
